# The systemd user and system instances don't share units. So, we have
# the *system* tails-wait-until-tor-has-bootstrapped.service create
# a file upon completion -- and the identically named *user* unit file wait for
# that file to appear.

[Unit]
Description=Wait for Tor to Have Bootstrapped
Documentation=https://tails.boum.org/contribute/design/

[Service]
Type=oneshot
ExecStart=/bin/sh -c '[ "$(/usr/bin/id -u)" = 1000 ] || exit 0         ; \
                      while ! [ -e /run/tor-has-bootstrapped/done ] ; do \
                         /bin/sleep 1                                  ; \
                      done'
TimeoutStartSec=0

[Install]
WantedBy=desktop.target
